package net.lab1024.sa.user.module.business.mall.service;

import java.util.List;
import net.lab1024.sa.user.module.business.mall.dao.FrontCategoryDao;
import net.lab1024.sa.user.module.business.mall.domain.form.FrontCategoryQueryForm;
import net.lab1024.sa.user.module.business.mall.domain.vo.FrontCategoryVO;
import net.lab1024.sa.common.common.util.SmartPageUtil;
import net.lab1024.sa.common.common.domain.PageResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 前台类目 Service
 *
 * @Author jabari
 * @Date 2023-06-01 15:12:18
 * @Copyright 51dev.cn
 */

@Service
public class FrontCategoryService {

    @Autowired
    private FrontCategoryDao frontCategoryDao;

    /**
     * 分页查询
     *
     * @param queryForm
     * @return
     */
    public PageResult<FrontCategoryVO> queryPage(FrontCategoryQueryForm queryForm) {
        Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
        List<FrontCategoryVO> list = frontCategoryDao.queryPage(page, queryForm);
        PageResult<FrontCategoryVO> pageResult = SmartPageUtil.convert2PageResult(page, list);
        return pageResult;
    }

}
